TOOL.Category = 'Mining'
TOOL.Name = 'Refineries'
TOOL.Command = nil
TOOL.ConfigName = ''

if (CLIENT and GetConVarNumber("RD_UseLSTab") == 1) then TOOL.Tab = "ESN Customs" end

TOOL.ClientConVar['wrtype'] = 'turbine_small'

cleanup.Register('refineries')

if ( CLIENT ) then
	language.Add( 'Tool_refineries_name', 'Mineral Refineries' )
	language.Add( 'Tool_refineries_desc', 'Create Mineral Refineries' )
	language.Add( 'Tool_refineries_0', 'Click to spawn a device. Right click to spawn without weld.' )
	language.Add( 'Undone_refineries', 'Undone Mineral Refinery.' )
end

if not ( RES_DISTRIB == 2 ) then Error("Please Install Resource Distribution 2 Addon.'" ) return end

local refineries = {}
if (SERVER) then
	refineries.minor_ore_refinery = function( ply, ent, system_type, system_class, model )
		local maxhealth = 800
		local mass = 5500
		RD_AddResource(ent, "energy", 0)
		RD_AddResource(ent, "Feldspar", 0)
		RD_AddResource(ent, "Carbon", 0)
		RD_AddResource(ent, "Quartz", 0)
		LS_RegisterEnt(ent, "Generator")
		return {}, maxhealth, mass
	end

	refineries.moderate_ore_refinery = function( ply, ent, system_type, system_class, model )
		local maxhealth = 800
		local mass = 5500
		RD_AddResource(ent, "energy", 0)
		RD_AddResource(ent, "steam", 0)
		LS_RegisterEnt(ent, "Generator")
		return {}, maxhealth, mass
	end



end

local refineries_models = {

	{ 'Minor Ore Refinery', 'models/Slyfo/ftl_drive.mdl', 'minor_ore_refinery' },
	--{ 'Moderate Ore Refinery', 'models/Slyfo/refinery_small.mdl', 'moderate_ore_refinery' },
	--{ 'Intensive Ore Refinery', 'models/Slyfo/refinery_large.mdl', 'intensive_ore_refinery' },

}	


RD2_ToolRegister( TOOL, refineries_models, nil, "refineries", 30, refineries )


